<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/commonHead :: commonHead('权限管理')"></head>
<body>
<div th:replace="/common/titleNav :: titleNavDiv"></div>
<div class="content" th:with="oneMenu='2',twoMenu='3'">
    <div th:replace="/common/sidebarNav :: sidebarDiv"></div>
    <div class="main">
        <div class="right">
            <div class="title">
                <a class="btn btn-primary" href="javascript:void(0);" id="btnAdd">新增权限</a>
            </div>
            <form th:action="@{/authorities/list}" method="post" id="queryForm">
                <input type="hidden" name="id" value=""/>
                <input type="hidden" name="page" th:value="${entity.page}"/>
                <input type="hidden" name="rows" th:value="${entity.rows}"/>
                <table class="table table-form">
                    <thead>
                    <tr>
                        <td width="8%"></td>
                        <td width="22%"></td>
                        <td width="8%"></td>
                        <td width="22%"></td>
                        <td width="8%"></td>
                        <td width="22%"></td>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td align="right"><span class="form-label">权限名称:</span></td>
                        <td>
                            <input type="text" class="form-control" placeholder="请输入" name="name"
                                   th:value="${entity.name}">
                        </td>
                        <td align="right"><span class="form-label">权限描述:</span></td>
                        <td>
                            <input type="text" class="form-control" placeholder="请输入" name="description"
                                   th:value="${entity.description}">
                        </td>
                        <td align="right"><span class="form-label">状态:</span></td>
                        <td>
                            <select class="default-basic-single" style="width:100%;" name="enabled">
                                <option value="">请选择</option>
                                <option value="1" th:selected="${entity.enabled eq '1'}">启用</option>
                                <option value="0" th:selected="${entity.enabled eq '0'}">禁用</option>
                            </select>
                        </td>
                    </tr>

                    <tr>
                        <td align="right"><span class="form-label">权限API:</span></td>
                        <td colspan="5">
                            <input type="text" class="form-control" placeholder="请输入" name="permission"
                                   th:value="${entity.permission}">
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="5">
                            <a href="javascript:void(0);" class="btn btn-primary" id="btnQuery">查询</a>
                            <a href="javascript:void(0);" class="btn btn-default border-blue" style="margin-left:15px;"
                               id="btnReset">清空</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </form>
            <div style="overflow-x:auto; padding: 0 5px;">
                <table class="table table-bordered table-striped table-condensed table-hover"
                       style="table-layout: fixed;" name="resizableTable">
                    <thead>
                    <tr>
                        <th width="20%">权限名称</th>
                        <th width="20%">权限描述</th>
                        <th width="10%">状态</th>
                        <th width="15%">权限API</th>
                        <th width="15%">创建时间</th>
                        <th width="15%">更新时间</th>
                        <th width="5%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr th:entity-id="${entity.id}" th:each="entity : ${rows}">
                            <td th:title="${entity.name}" th:text="${entity.name}"></td>
                            <td th:title="${entity.description}" th:text="${entity.description}"></td>
                            <td th:title="${entity.enabled == 0 ?'禁用':'启用'}" th:text="${entity.enabled == 0 ?'禁用':'启用'}"></td>
                            <td th:title="${entity.permission}" th:text="${entity.permission}"></td>
                            <td th:title="${entity.createTime}" th:text="${entity.createTime}"></td>
                            <td th:title="${entity.updateTime}" th:text="${entity.updateTime}"></td>
                            <td>
                                <a class="action" name="edit" th:entity-id="${entity.id}"><i class="glyphicon glyphicon-edit"></i></a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <ul class="pagination" id="pagination"></ul>
            <div class="page-msg">共<span th:text="${total}"></span>记录</div>
        </div>
    </div>
</div>
</div>

<input type="hidden" th:value="${total}" id="totalValue">
<script type="text/javascript" th:src="@{/static/javascript/admin/authorities/list.js}"></script>
</body>
</html>